//
//  PxHomePageController.m
//  PxHelper
//
//  Created by lpc on 2019/10/18.
//  Copyright © 2019 lpc. All rights reserved.
//

#import "PxHomePageController.h"
#import "PxWebController.h"

@interface PxHomePageController ()

@end

@implementation PxHomePageController

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (IBAction)showWebView:(id)sender {
    PxWebController *web = [[PxWebController alloc] initWithSelfClassNib];
    [self.navigationController pushViewController:web animated:YES];
}

- (IBAction)showDataClick:(id)sender {
    [self requestConfigFile];
}

- (void)requestConfigFile {
//    码云json文件获取 https://gitee.com/jsbyfl/iostest/blob/master/package.json
    NSString *str = @"https://gitee.com/jsbyfl/iostest/raw/master/package.json";

//    github json文件获取 https://github.com/robinson911/robinson911/blob/master/ljweibo.json";
//    str = @"https://raw.githubusercontent.com/robinson911/robinson911/master/ljweibo.json";

    NSURL *url = [NSURL URLWithString:str];
    [PxRequestHelper getWithUrl:url params:@{} completion:^(NSData *data, NSURLResponse *response, NSError *error) {
        NSDictionary *dic = data.mj_JSONObject;
        NSLog(@"%@", dic);
    }];
}

@end
